package com.hirain.command;

/**
 * Created by caicf on 2016/8/24.
 */
//这是一个命令，所以要实现Command接口
public class LightOnCommand implements Command {

    private Light light;

    public LightOnCommand(Light light) {
        this.light=light;
    }

    @Override
    public void undo() {
        light.off();
    }

    @Override
    public void execute() {
        light.on();
    }
}
